package com.jinsilu.freight.ui.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.jinsilu.freight.R;
import com.jinsilu.freight.http.response.Suggestions;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * 投诉建议列表信息
 *
 * @author yangyang
 * @time 2020-11-10 16:00
 */
public class SuggestionsListAdapter extends BaseQuickAdapter<Suggestions, BaseViewHolder> {

    public SuggestionsListAdapter(@Nullable List<Suggestions> data) {
        super(R.layout.item_suggestions_list, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, Suggestions s) {
        holder.setText(R.id.tv_questions, String.format("%s", TextUtils.isEmpty(s.getIdea()) ? "" : s.getIdea()))
                .setText(R.id.tv_answer, String.format("%s", s.getStatus() == 0 ? "暂未回复" : TextUtils.isEmpty(s.getReply()) ? "" : s.getReply()));
    }
}
